;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (wigust packages hashset-cpp)
  #:use-module (ice-9 match)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix git-download)
  #:use-module (gnu packages)
  #:use-module (guix build-system gnu))

(define-public hashset-cpp
  (let ((commit "f427324d667d7188a9e0975cca7f3a8c06226b4d")
        (revision "1"))
    (package
      (name "hashset-cpp")
      (version (string-append "0.0.1" revision "."
                              (string-take commit 7)))
      (source (origin
                (method git-fetch)
                (uri (git-reference
                      (url "https://github.com/bbondy/hashset-cpp")
                      (commit commit)))
                (file-name (string-append name "-" version "-checkout"))
                (sha256
                 (base32
                  "1y5q81zsf3z9b5s4v194ayffpjfc168wgl4k5f3r9krbzh1psfrx"))))
      (arguments
       `(#:make-flags
         (list (string-append "PREFIX=" %output))
         #:phases
         (modify-phases %standard-phases
           (delete 'configure))))
      (build-system gnu-build-system)
      (home-page "https://github.com/bbondy/hashset-cpp")
      (synopsis "Hashtable with serialization and deserialization")
      (description "Implements a simple HashSet for strings in environments
where you don't have the std lib available.  You should probably not be using
this. Instead consider using hash_set which is a more generic implementation
with templates.  This is only useful for very specific use cases having
specific memory layout requirements.")
      (license license:mpl2.0))))
